module ActiveDirectory
  module Schema
    module Computer
      include ActiveDirectory::Schema::Base
    
      def schema
        {
          :name =>                    [ String, :public, nil ],
          :dNSHostName =>             [ String, :public, nil ],
          :operatingSystem =>         [ String, :public, nil ],
          :operatingSystemVersion =>  [ String, :public, nil ],
          :sAMAccountName =>          [ String, :public, nil ]
        }
      end
    
      def filter(custom_filter = nil)
        "(&(objectCategory=Computer)(objectClass=computer)#{custom_filter})"
      end

      def primary_identifier_attribute
        'cn'
      end
  
      def self.extended(parent_klass)
        ActiveDirectory::Schema.extend_with_schema(parent_klass)
      end
    end
  end
end
